let http = require('http');
let server = http.createServer((req,res)=>{
    res.setHeader('Content-Type','text/html;charset=utf-8')
    res.setHeader('Content-Type','text/plain;charset=utf-8')
    res.setHeader('Content-Type','text/css;charset=utf-8')
    res.setHeader('Content-Type','text/javascript;charset=utf-8')
    res.setHeader('Content-Type','application/json;charset=utf-8')
    res.setHeader('Content-Type','image/jpeg;charset=utf-8')
    if(req.url == '/' || req.url == '/index'){
        res.end('进入首页')
    }else if(req.url == '/login'){
        res.end('登入页面')
    }else if(req.url == '/reg'){
        res.end('注册页面')
    }else if(req.url == '/product'){
        res.end('产品列表')
    }else if(req.url =='/indent'){
        req.end('订单列表')
    }else{
        res.end('404')
    }
}).listen(3000,()=>{
    console.log('服务器已启动，打开浏览器输入网址: 127.0.0.1')
})